﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace Brio.Framework.Operators
{
    public class ViralInjectionOperator : MusicalOperator
    {
        public ViralInjectionOperator(int percentage) : base("ViralInjection", percentage, OperatorType.Haploid) { }


        public override void Apply(MotifChromosome chromo, TechniqueCollection techniqueCollection)
        {
            int injectionPoint = Constants.Random.Next(chromo.Staff.Measures * 4);
            int techniqueIndex = Constants.Random.Next(techniqueCollection.Count);

            chromo.Staff.Inject(techniqueCollection.ElementAt(techniqueIndex).Value, injectionPoint);
        }


        public override void Apply(MotifChromosome chromo)
        {
            // UNSUPPORTED
        }

        public override void Apply(MotifChromosome doner, MotifChromosome reciever)
        {
            // UNSUPPORTED
        }

        public override void Apply(MotifChromosome chromo, IntervalRelationshipTable intervalRelationships)
        {
            // UNSUPPORTED
        }

    }
}
